<form class="page-wrap" method="post" action="./doc/json/ajaxDone.json" onsubmit="return $.validateCallback(this, navViewAjaxDone)">

	<header>
		<div class="toolbar">
			<a class="bar-button back-button"><i class="dwz-icon-arrow-left"></i></a>
			<div class="header-title">表单提交 + 主从表</div>
		</div>
	</header>

	<section>

		<div class="scroll-content dwz-scroll">
			<div class="scroll">

				<div class="form-content">
					<div class="legend">主表</div>

					<div class="form-item">
						<div class="item-content">
							<label>房间号</label>
							<input type="tel" name="sn" class="required" data-error="请输入房间号">
						</div>
					</div>
					<div class="form-item">
						<div class="item-content">
							<label>户型</label>
							<input class="required is-inline is-right" type="number" name="room" maxlength="5" data-error="请输入户型-室"><span>室&nbsp;</span>
							<input class="required is-inline is-right" type="number" name="office" maxlength="5" data-error="请输入户型-厅"><span>厅&nbsp;</span>
							<input class="required is-inline is-right" type="number" name="toilet" maxlength="5" data-error="请输入户型-卫"><span>卫</span>
						</div>
					</div>
					<div class="form-item">
						<div class="item-content">
							<label>明细表</label>
							<select name="type" class="required toggleSelectRef" data-ref-box="#widget_form4_detail_box|#widget_form4_detail_btn" data-ref-val="1|1">
								<option value="1">启用</option>
								<option value="2">禁用</option>
							</select>
						</div>
					</div>

					<div id="widget_form4_detail_box" class="dwz-item-detail-box">
						<div class="legend">明细表</div>

						<div class="unitBox">
							<div class="form-item">
								<div class="item-content">
									<label>姓名</label>
									<input type="text" name="realname[]" placeholder="请输入姓名" class="required" maxlength="10" data-error="请输入姓名">
								</div>
							</div>
							<div class="form-item">
								<div class="item-content">
									<label>手机号</label>
									<input type="tel" name="mobile[]" value="" class="required dwz-clipboard" placeholder="11位手机号" maxlength="11" data-pattern="[0-9]{11,11}" data-error="请输入11位手机号">
								</div>
							</div>
							<div class="divider"></div>
						</div>
					</div>

				</div>
			</div>
		</div>
	</section>


	<footer>
		<div class="form-bar padding-h">
			<button id="widget_form4_detail_btn" class="button dwz-item-detail-btn" type="button">新增明细</button>
			<button class="button primary" type="submit">提交</button>
		</div>
	</footer>

</form>

<script id="tpl_item_detail" type="text/html">
	<div class="unitBox">
		<div class="form-item">
			<div class="item-content">
				<label>姓名</label>
				<input type="text" name="realname[]" placeholder="请输入姓名" class="required" maxlength="10" data-error="请输入姓名">
				<a class="icon" onclick="biz.helper.removeUnitBox(this)"><i class="dwz-icon-delete"></i></a>
			</div>
		</div>
		<div class="form-item">
			<div class="item-content">
				<label>手机号</label>
				<input type="tel" name="mobile[]" value="" class="required dwz-clipboard" placeholder="11位手机号" maxlength="11" data-pattern="[0-9]{11,11}" data-error="请输入11位手机号">
			</div>
		</div>
		<div class="divider"></div>
	</div>
</script>